<?php
function smarty_modifier_truncate_d($string, $length = 10, $etc = '...'){

//    p($string);
//    mb_substr($str, $start);
    if(mb_strlen($string,"utf8")<=$length){
    	//这里全部返回
    	return mb_substr($string,0,$length,"utf8");
    }else{
    	return mb_substr($string,0,$length,"utf8") . $etc;
    }

}

/* vim: set expandtab: */

?>
